<template>
  <a-config-provider :locale="zhCN">
    <router-view />
  </a-config-provider>
</template>

<script setup lang="ts">
import { nextTick, provide, ref } from "vue";
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import "@/style/iconfont.js"
import 'dayjs/locale/zh-cn';

window.addEventListener('beforeunload', () => {
  console.log('组件卸载前触发');
});
// 全局汉化
dayjs.locale('zh-cn');
// 页面刷新
const isRouterAlive = ref(true);
const reload = () => {
  isRouterAlive.value = false;
  nextTick(() => {
    isRouterAlive.value = true;
  });
};
provide("reload", reload);
</script>
  
<style>
@import "@/style/base.less";
</style>
